

// 显示在游戏界面上的 Text

let BaseView = require('./BaseView');

let templateDiv = `
   <p id="texFps">fps:</p>
`;


require('./css/gametext.css');
class GameTextView extends BaseView{
    constructor(){
        super();

        this.rootEl = document.createElement('div');
        this.rootEl.classList.add('gametext_ui');
        this.rootEl.innerHTML = templateDiv;

        this.lbFps = this.rootEl.querySelector('#texFps');
        this.lbFps.textContent = '0';
    }

    updateLbFps(text){
        this.lbFps.textContent = `FPS:${text}`;
    }
}

module.exports = GameTextView;
